package test.nettys.sec;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * @Author wangshaopeng
 * @Date 2021/6/17
 */
public class MyClient {


    public static void main(String[] args) throws InterruptedException {
        EventLoopGroup group = new NioEventLoopGroup();

        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(group).channel(NioSocketChannel.class)
                .handler(new MyClientInitializer());
        ChannelFuture future = bootstrap.connect("localhost", 8899).sync();
        future.channel().closeFuture().sync();


    }
}
